﻿using RealtorsPortal.Entities;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;

namespace RealtorsPortal.Data_Access_Layer
{
    public class SubcriptionDAL
    {
        DataAccessHelper dah = new DataAccessHelper();
        public DataTable InsertToSubcription(Subcription subObj) {
            DataTable dt = new DataTable();

            List<SqlParameter> paraList = new List<SqlParameter>();
            SqlParameter para;

            para = new SqlParameter("@SubDate", SqlDbType.NVarChar);
            para.Value = subObj.SubDate;
            paraList.Add(para);
            para = new SqlParameter("@UserId", SqlDbType.Int);
            para.Value = subObj.UserId;
            paraList.Add(para);
            para = new SqlParameter("@PackageId", SqlDbType.Int);
            para.Value = subObj.PackageId;
            paraList.Add(para);
            para = new SqlParameter("@IsPaid", SqlDbType.NVarChar);
            para.Value = subObj.IsPaid;
            paraList.Add(para);
            return dah.GetData("sp_InsertIntoSubscription", paraList);
        }
    }
}